#include<iostream>
#include<algorithm>
using namespace std;
const int N = 2e4 + 10;
int arr[N];
int n, h;
int cmp(int a, int b)
{
	return a > b;
}

int main()
{
	cin >> n >> h;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	sort(arr, arr + n, cmp);
	int i = 0;
	int sum = 0;
	int count = 0;
	while (sum < h) {
		sum += arr[i++];
		count++;
	}
	cout << count << endl;
	return 0;
}